<ion-view view-title="{{'CHATS_TITLE' | translate}}">
  <!--ion-header-bar class="bar bar-subheader bar-stable" hide-on-scroll="true">
   <tags-input ng-model="topicsList" placeholder="Add a topic" on-tag-added="addTopicFilter($tag)" on-tag-removed="removeTopicFilter($tag)">
   </tags-input>
  </ion-header-bar-->
   <ion-content class="has-footer has-tabs chat" delegate-handle="chatScroll" >
   <div class="message-list" ng-show="shhEnabled">
      <div ng-repeat="chat in chats | orderBy:'message.time'"
        class="message-wrapper">
        <div ng-class="chat.message.from === myidentity ? 'bubble bubble-mine' : 'bubble bubble-other'">
            <img on-hold="chooseAction(chat.message)" ng-src="{{chat.identity}}" ng-class="chat.message.from === myidentity ? 'rounded image image-mine' : 'rounded image image-other'""> 
          <div class="message" ng-class="chat.message.from === myidentity ? 'message-mine' : 'message-other'" on-hold="chooseAction(chat.message)">
            <img ng-src="{{chat.message.image}}" height="100px" width="auto" ng-if="chat.message.image.length"/>
            <div class="message-text" ng-if="chat.message.text.length" ng-bind-html="chat.message.text"></div>
            <span class="message-timestamp">{{isFriend(chat.message.from) | strLimit: 5 : 0}} {{chat.message.time == undefined ? 'outdated v.' : chat.message.time | date: 'HH:mm'}}</span>
          </div>
          <i class="icon ion-android-checkmark-circle balanced" ng-if="chat.delivered"></i>&nbsp;
          <i class="icon ion-bug assertive" ng-if="chat.error"></i>&nbsp;
        </div>
      </div>
    </div>
  </ion-content>  
  <div class="assertive bar bar-footer bar-stable has-tabs" ng-show="!shhEnabled || !isOnline">
    <p>Chat not available :-(  Check connection and host node!</p>
  </div>
  <div align-title="left" keyboard-attach class="bar bar-footer bar-stable has-tabs item-input-inset" ng-show="shhEnabled && isOnline"">
    <button class="button button-clear button-icon button-positive icon ion-ios-plus-empty" ng-click="shareItems()"></button>
    <label class="item-input-wrapper">
      <input
        ng-model="text.message"
        on-return="sendMessage()"
        dir="auto"
        type="text"/>
    </label>
    <span ng-if="text.message.length > 0">
      <button ng-click="sendMessage()" class="button button-clear button-positive">
          <i class="icon ion-ios-paperplane"></i>
      </button>
    </span>
    <span ng-if="!text.message || text.message.length === 0">
      <button class="button button-clear button-icon button-positive icon ion-ios-camera-outline" ng-click="getPhoto()"></button>
      <!--i class="buttons-seperator icon ion-android-more-vertical"></i>
      <button class="button button-clear button-icon button-positive icon ion-ios-mic-outline"></button-->
    </span>
  </div>
</ion-view>

        
        
